﻿/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
	/**
	 * built-in config
	 * @type {Egg.EggAppConfig}
	 **/
	const config = exports = {};
	//关闭csrf
	config.security = {
		csrf: {
			enable: false
		}
	}
	//开启文件上传
	config.multipart = {
		mode: 'file',
	};
	
	config.cors = {
		origin: '*',
	};

	//上传文件的大小设置
	config.bodyParser = {
		    jsonLimit: '1024*8mb',
		    formLimit: '1024*8mb',
		};
	// mysql连接配置
	config.mysql={
	    client:{
	      //host
	      host:"localhost",
	      //端口
	      port:"3306",
	      //用户名
	      user:"root",
	      //密码
	      password:"root",
	      //数据库名
	      database:"shangchufang"   
	    }
	  }


	// use for cookie sign key, should change to your own and keep security
	config.keys = appInfo.name + '_1624428990938_7418';

	// add your middleware config here
	config.middleware = [];

	// add your user config here
	const userConfig = {
		// myAppName: 'egg',
	};

	return {
		...config,
		...userConfig,
	};
};
